//
// Created by guqiao on 20-7-16.
// 静态注册
//


//#include <jni.h>


/*extern "C"
JNIEXPORT jstring JNICALL
Java_com_guqiao_sdk_Sdk_callNativeMethod(JNIEnv *env, jobject thiz, jstring text) {
    jclass clazz = env->GetObjectClass(thiz);
    jmethodID methodId = env->GetMethodID(clazz,"callJavaMethod", "(Ljava/lang/String;)V");
    env->CallVoidMethod(thiz,methodId,text);
    return env->NewStringUTF("成功调用Java普通方法");
}*/

/*extern "C"
JNIEXPORT jstring JNICALL
Java_com_guqiao_sdk_Sdk_staticCallNativeMethod(JNIEnv *env, jclass clazz, jstring text) {
    jmethodID methodId = env->GetStaticMethodID(clazz,"callStaticJavaMethod","(Ljava/lang/String;)V");
    env->CallStaticVoidMethod(clazz,methodId,text);
    return env->NewStringUTF("成功调用java静态方法");
}*/

/*extern "C"
JNIEXPORT void JNICALL
Java_com_guqiao_sdk_Sdk_changeJavaField(JNIEnv *env, jobject thiz) {
    jclass clazz = env->GetObjectClass(thiz);
    jfieldID fieldId = env->GetFieldID(clazz,"name", "Ljava/lang/String;");
    jstring name = static_cast<jstring>(env->GetObjectField(thiz, fieldId));
    jstring newValue = env->NewStringUTF("我是新的属性值");
    env->SetObjectField(thiz,fieldId,newValue);
}*/

/*extern "C"
JNIEXPORT void JNICALL
Java_com_guqiao_sdk_Sdk_changeJavaStaticField(JNIEnv *env, jobject thiz) {
    jclass clazz = env->GetObjectClass(thiz);
    jfieldID fieldId = env->GetStaticFieldID(clazz,"index", "I");
    jint value = env->GetStaticIntField(clazz,fieldId);
    jint newIndex = value + 10;
    env->SetStaticIntField(clazz,fieldId,newIndex);
}*/